## `summarise()` has grouped output by 'timepoint', 'treatment'. You can override using the `.groups` argument.
## # A tibble: 16 × 6
## # Groups: treatment [2]
## treatment Cow_ID `0` `8` `21` `28`
## <chr> <chr> <int> <int> <int> <int>
## 1 Control 4251 AG 1 1 1 1
## 2 Control 4251 ARD 1 1 1 1
## 3 Control 4330 ARD 1 1 1 1
## 4 Control 5303 ARD 1 1 1 1
## 5 Control 6201 AG 1 1 1 1
## 6 Control 6201 ARG 1 1 1 1
## 7 Control 6221 ARG 1 1 1 1
## 8 Control 6249 AG 1 1 1 1
## 9 Treated 4252 AD 1 1 1 1
## 10 Treated 4252 AG 1 1 1 1
## 11 Treated 4287 AG 1 1 1 1
## 12 Treated 5240 AD 1 1 1 1
## 13 Treated 5240 ARD 1 1 1 1
## 14 Treated 5250 AD 1 1 1 1
## 15 Treated 6261 ARD 1 1 1 1
## 16 Treated 7249 ARG 1 1 1 1
First, let’s look at phyla:
| phylum | treatment | timepoint | N | avg_abund | std |
|---|---|---|---|---|---|
| Firmicutes | Control | 28 | 8 | 0.2414 | 0.119 |
| Firmicutes | Control | 21 | 8 | 0.2753 | 0.090 |
| Firmicutes | Control | 8 | 8 | 0.3945 | 0.129 |
| Firmicutes | Control | 0 | 8 | 0.4610 | 0.127 |
| Proteobacteria | Control | 0 | 8 | 0.2176 | 0.104 |
| Proteobacteria | Control | 8 | 8 | 0.2911 | 0.147 |
| Proteobacteria | Control | 21 | 8 | 0.3559 | 0.111 |
| Proteobacteria | Control | 28 | 8 | 0.4594 | 0.161 |
| Actinobacteria | Control | 0 | 8 | 0.1225 | 0.059 |
| Actinobacteria | Control | 8 | 8 | 0.1344 | 0.049 |
| Actinobacteria | Control | 21 | 8 | 0.1785 | 0.029 |
| Actinobacteria | Control | 28 | 8 | 0.1785 | 0.045 |
| Bacteroidetes | Control | 28 | 8 | 0.0766 | 0.050 |
| Bacteroidetes | Control | 21 | 8 | 0.1120 | 0.035 |
| Bacteroidetes | Control | 8 | 8 | 0.1148 | 0.026 |
| Bacteroidetes | Control | 0 | 8 | 0.1341 | 0.023 |
| Firmicutes | Treated | 28 | 8 | 0.3689 | 0.108 |
| Firmicutes | Treated | 8 | 8 | 0.3781 | 0.123 |
| Firmicutes | Treated | 21 | 8 | 0.4007 | 0.147 |
| Firmicutes | Treated | 0 | 8 | 0.4081 | 0.087 |
| Proteobacteria | Treated | 21 | 8 | 0.2458 | 0.127 |
| Proteobacteria | Treated | 0 | 8 | 0.2507 | 0.079 |
| Proteobacteria | Treated | 8 | 8 | 0.2855 | 0.147 |
| Proteobacteria | Treated | 28 | 8 | 0.3000 | 0.164 |
| Actinobacteria | Treated | 21 | 8 | 0.1149 | 0.038 |
| Actinobacteria | Treated | 0 | 8 | 0.1438 | 0.033 |
| Actinobacteria | Treated | 28 | 8 | 0.1540 | 0.021 |
| Actinobacteria | Treated | 8 | 8 | 0.1577 | 0.039 |
| Bacteroidetes | Treated | 28 | 8 | 0.1135 | 0.044 |
| Bacteroidetes | Treated | 8 | 8 | 0.1147 | 0.035 |
| Bacteroidetes | Treated | 0 | 8 | 0.1308 | 0.021 |
| Bacteroidetes | Treated | 21 | 8 | 0.1487 | 0.025 |
###boxplot abundances per timepoint and treatment
##Phyla
##
## 2 3 4 5 6
## 2048 4416 10496 24832 69120
A table of relative abundances (and standard deviations) per taxa and treatment:
| level | new_taxa | treatment | timepoint | avg_abund | std |
|---|---|---|---|---|---|
| class | Clostridia | Control | 0 | 0.3587 | 0.158 |
| class | Gammaproteobacteria | Control | 28 | 0.3224 | 0.102 |
| class | Clostridia | Treated | 21 | 0.2907 | 0.161 |
| class | Clostridia | Treated | 0 | 0.2875 | 0.092 |
| class | Clostridia | Control | 8 | 0.2556 | 0.132 |
| class | Clostridia | Treated | 28 | 0.2478 | 0.086 |
| class | Clostridia | Treated | 8 | 0.2419 | 0.118 |
| class | Gammaproteobacteria | Control | 21 | 0.2209 | 0.068 |
| class | Gammaproteobacteria | Treated | 28 | 0.2116 | 0.113 |
| class | Gammaproteobacteria | Control | 8 | 0.1972 | 0.100 |
| class | Gammaproteobacteria | Treated | 0 | 0.1826 | 0.042 |
| class | Gammaproteobacteria | Treated | 8 | 0.1801 | 0.098 |
| class | Clostridia | Control | 21 | 0.1766 | 0.084 |
| class | Actinobacteria | Control | 28 | 0.1734 | 0.048 |
| class | Gammaproteobacteria | Treated | 21 | 0.1602 | 0.092 |
| class | Actinobacteria | Control | 21 | 0.1590 | 0.031 |
| class | Gammaproteobacteria | Control | 0 | 0.1545 | 0.067 |
| class | Bacteroidia | Treated | 21 | 0.1487 | 0.025 |
| class | Actinobacteria | Treated | 8 | 0.1444 | 0.037 |
| class | Clostridia | Control | 28 | 0.1438 | 0.102 |
| class | Actinobacteria | Treated | 28 | 0.1416 | 0.019 |
| class | Alphaproteobacteria | Control | 28 | 0.1358 | 0.068 |
| class | Bacteroidia | Control | 0 | 0.1341 | 0.023 |
| class | Actinobacteria | Treated | 0 | 0.1334 | 0.031 |
| class | Alphaproteobacteria | Control | 21 | 0.1331 | 0.050 |
| class | Bacteroidia | Treated | 0 | 0.1308 | 0.021 |
| class | Bacilli | Control | 8 | 0.1244 | 0.054 |
| class | Actinobacteria | Control | 8 | 0.1237 | 0.047 |
| class | Bacilli | Treated | 8 | 0.1227 | 0.032 |
| class | Bacteroidia | Control | 8 | 0.1148 | 0.026 |
| class | Bacteroidia | Treated | 8 | 0.1147 | 0.035 |
| class | Bacteroidia | Treated | 28 | 0.1135 | 0.044 |
| class | Bacteroidia | Control | 21 | 0.1120 | 0.035 |
| class | Actinobacteria | Control | 0 | 0.1109 | 0.060 |
| class | Bacilli | Treated | 28 | 0.1079 | 0.022 |
| class | Bacilli | Treated | 0 | 0.1061 | 0.013 |
| class | Actinobacteria | Treated | 21 | 0.1008 | 0.038 |
| class | Alphaproteobacteria | Treated | 8 | 0.0995 | 0.051 |
| class | Bacilli | Treated | 21 | 0.0952 | 0.036 |
| class | Alphaproteobacteria | Control | 8 | 0.0915 | 0.050 |
| class | Bacilli | Control | 21 | 0.0877 | 0.022 |
| class | Bacilli | Control | 0 | 0.0864 | 0.044 |
| class | Alphaproteobacteria | Treated | 28 | 0.0857 | 0.057 |
| class | Bacilli | Control | 28 | 0.0856 | 0.029 |
| class | Alphaproteobacteria | Treated | 21 | 0.0810 | 0.043 |
| class | Bacteroidia | Control | 28 | 0.0766 | 0.050 |
| class | Alphaproteobacteria | Treated | 0 | 0.0649 | 0.044 |
| class | Alphaproteobacteria | Control | 0 | 0.0599 | 0.042 |
| class | Erysipelotrichia | Control | 8 | 0.0104 | 0.004 |
| family | Ruminococcaceae | Control | 0 | 0.2013 | 0.119 |
| family | Ruminococcaceae | Treated | 21 | 0.1613 | 0.110 |
| family | Pseudomonadaceae | Control | 28 | 0.1409 | 0.065 |
| family | Ruminococcaceae | Treated | 0 | 0.1397 | 0.057 |
| family | Ruminococcaceae | Control | 8 | 0.1210 | 0.088 |
| family | Ruminococcaceae | Treated | 8 | 0.1189 | 0.067 |
| family | Ruminococcaceae | Treated | 28 | 0.1167 | 0.041 |
| family | Pseudomonadaceae | Control | 21 | 0.0825 | 0.045 |
| family | Ruminococcaceae | Control | 21 | 0.0813 | 0.051 |
| family | Propionibacteriaceae | Control | 28 | 0.0759 | 0.028 |
| family | Ruminococcaceae | Control | 28 | 0.0757 | 0.054 |
| family | Lachnospiraceae | Control | 0 | 0.0734 | 0.018 |
| family | Beijerinckiaceae | Control | 28 | 0.0675 | 0.032 |
| family | Pseudomonadaceae | Treated | 28 | 0.0672 | 0.071 |
| family | Pseudomonadaceae | Control | 8 | 0.0668 | 0.061 |
| family | Lachnospiraceae | Treated | 0 | 0.0626 | 0.023 |
| family | Lachnospiraceae | Control | 8 | 0.0598 | 0.019 |
| family | Pseudomonadaceae | Treated | 8 | 0.0593 | 0.055 |
| family | Lachnospiraceae | Treated | 21 | 0.0590 | 0.030 |
| family | Lachnospiraceae | Treated | 28 | 0.0582 | 0.023 |
| family | Lachnospiraceae | Treated | 8 | 0.0558 | 0.021 |
| family | Moraxellaceae | Control | 28 | 0.0522 | 0.012 |
| family | Halomonadaceae | Control | 28 | 0.0514 | 0.021 |
| family | Pseudomonadaceae | Treated | 0 | 0.0507 | 0.027 |
| family | Pseudomonadaceae | Treated | 21 | 0.0497 | 0.042 |
| family | Beijerinckiaceae | Control | 8 | 0.0459 | 0.037 |
| family | Moraxellaceae | Treated | 28 | 0.0456 | 0.010 |
| family | Pseudomonadaceae | Control | 0 | 0.0454 | 0.029 |
| family | Beijerinckiaceae | Control | 21 | 0.0453 | 0.022 |
| family | Propionibacteriaceae | Treated | 28 | 0.0445 | 0.021 |
| family | Moraxellaceae | Treated | 0 | 0.0441 | 0.011 |
| family | Staphylococcaceae | Control | 8 | 0.0438 | 0.048 |
| family | Prevotellaceae | Treated | 21 | 0.0427 | 0.018 |
| family | Beijerinckiaceae | Treated | 8 | 0.0424 | 0.029 |
| family | Lachnospiraceae | Control | 21 | 0.0423 | 0.015 |
| family | Staphylococcaceae | Treated | 8 | 0.0411 | 0.016 |
| family | Moraxellaceae | Control | 8 | 0.0405 | 0.014 |
| family | Propionibacteriaceae | Control | 21 | 0.0396 | 0.021 |
| family | Propionibacteriaceae | Treated | 0 | 0.0389 | 0.014 |
| family | Propionibacteriaceae | Control | 0 | 0.0379 | 0.026 |
| family | Propionibacteriaceae | Control | 8 | 0.0379 | 0.021 |
| family | Prevotellaceae | Treated | 0 | 0.0371 | 0.008 |
| family | Moraxellaceae | Control | 0 | 0.0369 | 0.020 |
| family | Prevotellaceae | Control | 8 | 0.0364 | 0.009 |
| family | Moraxellaceae | Treated | 8 | 0.0363 | 0.019 |
| family | Propionibacteriaceae | Treated | 8 | 0.0359 | 0.019 |
| family | Prevotellaceae | Control | 0 | 0.0354 | 0.007 |
| family | Micrococcaceae | Treated | 28 | 0.0352 | 0.014 |
| family | Micrococcaceae | Control | 28 | 0.0348 | 0.016 |
| family | Micrococcaceae | Treated | 0 | 0.0348 | 0.009 |
| family | Beijerinckiaceae | Treated | 28 | 0.0345 | 0.030 |
| family | Rikenellaceae | Control | 0 | 0.0345 | 0.014 |
| family | Moraxellaceae | Control | 21 | 0.0344 | 0.013 |
| family | Micrococcaceae | Treated | 8 | 0.0338 | 0.012 |
| family | Prevotellaceae | Treated | 28 | 0.0333 | 0.012 |
| family | Halomonadaceae | Control | 21 | 0.0329 | 0.015 |
| family | Rikenellaceae | Treated | 0 | 0.0329 | 0.013 |
| family | Halomonadaceae | Control | 8 | 0.0324 | 0.024 |
| family | Prevotellaceae | Treated | 8 | 0.0322 | 0.011 |
| family | Rikenellaceae | Treated | 21 | 0.0322 | 0.017 |
| family | Lachnospiraceae | Control | 28 | 0.0317 | 0.026 |
| family | Staphylococcaceae | Control | 28 | 0.0316 | 0.022 |
| family | Christensenellaceae | Control | 0 | 0.0312 | 0.025 |
| family | Rikenellaceae | Treated | 28 | 0.0311 | 0.014 |
| family | Halomonadaceae | Treated | 28 | 0.0303 | 0.021 |
| family | Streptococcaceae | Control | 8 | 0.0299 | 0.013 |
| family | Streptococcaceae | Treated | 28 | 0.0296 | 0.015 |
| family | Streptococcaceae | Treated | 0 | 0.0290 | 0.011 |
| family | Micrococcaceae | Control | 0 | 0.0287 | 0.018 |
| family | Micrococcaceae | Control | 8 | 0.0287 | 0.011 |
| family | Moraxellaceae | Treated | 21 | 0.0275 | 0.018 |
| family | Staphylococcaceae | Treated | 28 | 0.0273 | 0.013 |
| family | Prevotellaceae | Control | 28 | 0.0272 | 0.021 |
| family | Rhizobiaceae | Control | 28 | 0.0268 | 0.023 |
| family | Christensenellaceae | Treated | 0 | 0.0261 | 0.011 |
| family | Staphylococcaceae | Control | 21 | 0.0261 | 0.015 |
| family | Prevotellaceae | Control | 21 | 0.0260 | 0.010 |
| family | Halomonadaceae | Treated | 8 | 0.0258 | 0.019 |
| family | Rikenellaceae | Control | 8 | 0.0256 | 0.009 |
| family | Streptococcaceae | Control | 0 | 0.0256 | 0.017 |
| family | Sphingomonadaceae | Control | 21 | 0.0253 | 0.012 |
| family | Beijerinckiaceae | Treated | 21 | 0.0252 | 0.021 |
| family | Rhizobiaceae | Control | 21 | 0.0248 | 0.018 |
| family | Rikenellaceae | Treated | 8 | 0.0247 | 0.014 |
| family | Beijerinckiaceae | Treated | 0 | 0.0246 | 0.018 |
| family | Streptococcaceae | Treated | 8 | 0.0244 | 0.012 |
| family | Christensenellaceae | Treated | 21 | 0.0242 | 0.015 |
| family | Corynebacteriaceae | Control | 21 | 0.0239 | 0.014 |
| family | Micrococcaceae | Control | 21 | 0.0239 | 0.008 |
| family | Beijerinckiaceae | Control | 0 | 0.0236 | 0.017 |
| family | Micrococcaceae | Treated | 21 | 0.0235 | 0.018 |
| family | Propionibacteriaceae | Treated | 21 | 0.0234 | 0.016 |
| family | Burkholderiaceae | Control | 21 | 0.0230 | 0.011 |
| family | Christensenellaceae | Control | 8 | 0.0229 | 0.021 |
| family | Staphylococcaceae | Treated | 21 | 0.0228 | 0.012 |
| family | Halomonadaceae | Treated | 0 | 0.0226 | 0.007 |
| family | Streptococcaceae | Treated | 21 | 0.0226 | 0.018 |
| family | Staphylococcaceae | Treated | 0 | 0.0224 | 0.009 |
| family | Halomonadaceae | Control | 0 | 0.0217 | 0.010 |
| family | Halomonadaceae | Treated | 21 | 0.0216 | 0.015 |
| family | Corynebacteriaceae | Treated | 8 | 0.0214 | 0.009 |
| family | Corynebacteriaceae | Control | 8 | 0.0207 | 0.015 |
| family | Staphylococcaceae | Control | 0 | 0.0207 | 0.011 |
| family | Bacteroidaceae | Control | 0 | 0.0205 | 0.009 |
| family | Peptostreptococcaceae | Treated | 28 | 0.0204 | 0.005 |
| family | Christensenellaceae | Treated | 28 | 0.0202 | 0.008 |
| family | Corynebacteriaceae | Control | 28 | 0.0201 | 0.010 |
| family | Peptostreptococcaceae | Treated | 8 | 0.0197 | 0.007 |
| family | Corynebacteriaceae | Treated | 0 | 0.0194 | 0.005 |
| family | Corynebacteriaceae | Treated | 28 | 0.0190 | 0.007 |
| family | Rikenellaceae | Control | 28 | 0.0188 | 0.013 |
| family | Peptostreptococcaceae | Treated | 0 | 0.0187 | 0.004 |
| family | Sphingomonadaceae | Treated | 8 | 0.0182 | 0.013 |
| family | Streptococcaceae | Control | 28 | 0.0181 | 0.014 |
| family | Carnobacteriaceae | Treated | 0 | 0.0178 | 0.007 |
| family | Rhizobiaceae | Treated | 28 | 0.0174 | 0.016 |
| family | Rikenellaceae | Control | 21 | 0.0173 | 0.009 |
| family | Peptostreptococcaceae | Control | 21 | 0.0168 | 0.011 |
| family | Christensenellaceae | Treated | 8 | 0.0166 | 0.013 |
| family | Bacteroidaceae | Treated | 21 | 0.0165 | 0.010 |
| family | Burkholderiaceae | Control | 28 | 0.0165 | 0.009 |
| family | Bacteroidaceae | Treated | 0 | 0.0164 | 0.006 |
| family | Streptococcaceae | Control | 21 | 0.0161 | 0.010 |
| family | Bacillaceae | Treated | 8 | 0.0159 | 0.008 |
| family | Peptostreptococcaceae | Control | 8 | 0.0159 | 0.009 |
| family | Flavobacteriaceae | Control | 21 | 0.0156 | 0.011 |
| family | Nocardioidaceae | Control | 21 | 0.0154 | 0.010 |
| family | Sphingomonadaceae | Treated | 21 | 0.0154 | 0.016 |
| family | Corynebacteriaceae | Control | 0 | 0.0153 | 0.010 |
| family | Rhizobiaceae | Treated | 21 | 0.0152 | 0.009 |
| family | Bacillaceae | Control | 21 | 0.0151 | 0.010 |
| family | Peptostreptococcaceae | Control | 0 | 0.0146 | 0.007 |
| family | Peptostreptococcaceae | Treated | 21 | 0.0136 | 0.005 |
| family | Carnobacteriaceae | Treated | 8 | 0.0135 | 0.007 |
| family | Bacillaceae | Treated | 21 | 0.0132 | 0.006 |
| family | Carnobacteriaceae | Control | 0 | 0.0132 | 0.008 |
| family | Carnobacteriaceae | Treated | 21 | 0.0132 | 0.007 |
| family | Carnobacteriaceae | Treated | 28 | 0.0132 | 0.006 |
| family | Carnobacteriaceae | Control | 8 | 0.0131 | 0.008 |
| family | Bacteroidaceae | Control | 8 | 0.0130 | 0.014 |
| family | Family XIII | Control | 0 | 0.0130 | 0.008 |
| family | Flavobacteriaceae | Treated | 21 | 0.0129 | 0.013 |
| family | Microbacteriaceae | Control | 21 | 0.0124 | 0.008 |
| family | Bacteroidaceae | Treated | 8 | 0.0121 | 0.005 |
| family | Sphingomonadaceae | Control | 8 | 0.0121 | 0.006 |
| family | Sphingomonadaceae | Control | 28 | 0.0121 | 0.009 |
| family | Lactobacillaceae | Treated | 28 | 0.0120 | 0.008 |
| family | Clostridiaceae 1 | Treated | 0 | 0.0119 | 0.007 |
| family | Shewanellaceae | Control | 28 | 0.0119 | 0.006 |
| family | Burkholderiaceae | Control | 8 | 0.0118 | 0.011 |
| family | Burkholderiaceae | Treated | 21 | 0.0118 | 0.008 |
| family | Sphingomonadaceae | Treated | 0 | 0.0118 | 0.014 |
| family | Xanthobacteraceae | Control | 21 | 0.0118 | 0.005 |
| family | Burkholderiaceae | Treated | 8 | 0.0117 | 0.006 |
| family | Christensenellaceae | Control | 21 | 0.0117 | 0.011 |
| family | Xanthomonadaceae | Control | 21 | 0.0117 | 0.005 |
| family | Rhizobiaceae | Treated | 8 | 0.0110 | 0.005 |
| family | Flavobacteriaceae | Treated | 0 | 0.0109 | 0.002 |
| family | Family XIII | Treated | 0 | 0.0108 | 0.004 |
| family | Bacteroidaceae | Treated | 28 | 0.0106 | 0.007 |
| family | Corynebacteriaceae | Treated | 21 | 0.0106 | 0.006 |
| family | Rhizobiaceae | Control | 0 | 0.0105 | 0.008 |
| family | Bacillaceae | Control | 8 | 0.0104 | 0.008 |
| family | Erysipelotrichaceae | Control | 8 | 0.0104 | 0.004 |
| family | Clostridiaceae 1 | Control | 8 | 0.0103 | 0.006 |
| genus | Pseudomonas | Control | 28 | 0.1405 | 0.065 |
| genus | Pseudomonas | Control | 21 | 0.0825 | 0.045 |
| genus | Cutibacterium | Control | 28 | 0.0734 | 0.028 |
| genus | Pseudomonas | Treated | 28 | 0.0671 | 0.071 |
| genus | Pseudomonas | Control | 8 | 0.0666 | 0.061 |
| genus | Methylobacterium | Control | 28 | 0.0603 | 0.033 |
| genus | Pseudomonas | Treated | 8 | 0.0592 | 0.055 |
| genus | Halomonas | Control | 28 | 0.0511 | 0.021 |
| genus | Pseudomonas | Treated | 0 | 0.0504 | 0.028 |
| genus | Pseudomonas | Treated | 21 | 0.0495 | 0.043 |
| genus | Ruminococcaceae UCG-010 | Control | 0 | 0.0459 | 0.025 |
| genus | Pseudomonas | Control | 0 | 0.0453 | 0.029 |
| genus | Cutibacterium | Treated | 28 | 0.0416 | 0.021 |
| genus | Methylobacterium | Control | 21 | 0.0401 | 0.022 |
| genus | Methylobacterium | Control | 8 | 0.0394 | 0.035 |
| genus | Ruminococcaceae UCG-005 | Control | 0 | 0.0393 | 0.020 |
| genus | Staphylococcus | Control | 8 | 0.0384 | 0.047 |
| genus | Staphylococcus | Treated | 8 | 0.0367 | 0.017 |
| genus | Cutibacterium | Control | 0 | 0.0365 | 0.027 |
| genus | Ruminococcaceae UCG-010 | Treated | 21 | 0.0362 | 0.023 |
| genus | Cutibacterium | Control | 21 | 0.0361 | 0.022 |
| genus | Cutibacterium | Treated | 0 | 0.0360 | 0.014 |
| genus | Ruminococcaceae UCG-005 | Treated | 21 | 0.0356 | 0.026 |
| genus | Ruminococcaceae UCG-010 | Treated | 0 | 0.0354 | 0.015 |
| genus | Cutibacterium | Control | 8 | 0.0350 | 0.022 |
| genus | Methylobacterium | Treated | 8 | 0.0349 | 0.027 |
| genus | Halomonas | Control | 21 | 0.0320 | 0.015 |
| genus | Halomonas | Control | 8 | 0.0313 | 0.024 |
| genus | Christensenellaceae R-7 group | Control | 0 | 0.0308 | 0.025 |
| genus | Cutibacterium | Treated | 8 | 0.0307 | 0.019 |
| genus | Ruminococcaceae UCG-005 | Treated | 0 | 0.0303 | 0.015 |
| genus | Halomonas | Treated | 28 | 0.0298 | 0.022 |
| genus | Streptococcus | Control | 8 | 0.0298 | 0.013 |
| genus | Ruminococcaceae UCG-010 | Control | 8 | 0.0295 | 0.018 |
| genus | Psychrobacter | Treated | 0 | 0.0292 | 0.010 |
| genus | Ruminococcaceae UCG-010 | Treated | 28 | 0.0291 | 0.013 |
| genus | Streptococcus | Treated | 28 | 0.0287 | 0.015 |
| genus | Ruminococcaceae UCG-005 | Control | 8 | 0.0286 | 0.026 |
| genus | Psychrobacter | Treated | 28 | 0.0283 | 0.007 |
| genus | Streptococcus | Treated | 0 | 0.0283 | 0.010 |
| genus | Ruminococcaceae UCG-010 | Treated | 8 | 0.0277 | 0.020 |
| genus | Methylobacterium | Treated | 28 | 0.0276 | 0.029 |
| genus | Staphylococcus | Control | 28 | 0.0272 | 0.020 |
| genus | Psychrobacter | Control | 8 | 0.0271 | 0.008 |
| genus | Christensenellaceae R-7 group | Treated | 0 | 0.0259 | 0.011 |
| genus | Streptococcus | Control | 0 | 0.0254 | 0.017 |
| genus | Halomonas | Treated | 8 | 0.0251 | 0.019 |
| genus | Psychrobacter | Control | 0 | 0.0249 | 0.014 |
| genus | Ruminococcaceae UCG-005 | Treated | 8 | 0.0244 | 0.013 |
| genus | Staphylococcus | Treated | 28 | 0.0243 | 0.012 |
| genus | Christensenellaceae R-7 group | Treated | 21 | 0.0241 | 0.015 |
| genus | Ruminococcaceae UCG-005 | Treated | 28 | 0.0241 | 0.007 |
| genus | Psychrobacter | Control | 28 | 0.0233 | 0.013 |
| genus | Streptococcus | Treated | 8 | 0.0233 | 0.011 |
| genus | Psychrobacter | Treated | 8 | 0.0232 | 0.008 |
| genus | Christensenellaceae R-7 group | Control | 8 | 0.0227 | 0.021 |
| genus | Staphylococcus | Control | 21 | 0.0224 | 0.017 |
| genus | Rikenellaceae RC9 gut group | Treated | 28 | 0.0223 | 0.010 |
| genus | Acinetobacter | Control | 28 | 0.0221 | 0.011 |
| genus | [Eubacterium] coprostanoligenes group | Control | 0 | 0.0219 | 0.009 |
| genus | Halomonas | Treated | 0 | 0.0219 | 0.008 |
| genus | Methylobacterium | Treated | 21 | 0.0219 | 0.022 |
| genus | Rikenellaceae RC9 gut group | Treated | 21 | 0.0219 | 0.011 |
| genus | Ruminococcaceae UCG-013 | Control | 0 | 0.0218 | 0.021 |
| genus | Prevotella 1 | Treated | 21 | 0.0217 | 0.011 |
| genus | Streptococcus | Treated | 21 | 0.0217 | 0.018 |
| genus | Rikenellaceae RC9 gut group | Control | 0 | 0.0213 | 0.008 |
| genus | Halomonas | Treated | 21 | 0.0212 | 0.015 |
| genus | Halomonas | Control | 0 | 0.0211 | 0.010 |
| genus | Cutibacterium | Treated | 21 | 0.0209 | 0.015 |
| genus | Rikenellaceae RC9 gut group | Treated | 0 | 0.0207 | 0.009 |
| genus | Bacteroides | Control | 0 | 0.0205 | 0.009 |
| genus | Psychrobacter | Treated | 21 | 0.0203 | 0.016 |
| genus | Christensenellaceae R-7 group | Treated | 28 | 0.0202 | 0.008 |
| genus | Prevotella 1 | Control | 28 | 0.0197 | 0.017 |
| genus | Prevotella 1 | Control | 8 | 0.0196 | 0.008 |
| genus | Methylobacterium | Treated | 0 | 0.0194 | 0.019 |
| genus | Staphylococcus | Treated | 21 | 0.0194 | 0.013 |
| genus | [Eubacterium] coprostanoligenes group | Treated | 21 | 0.0192 | 0.011 |
| genus | [Eubacterium] coprostanoligenes group | Treated | 0 | 0.0190 | 0.009 |
| genus | Staphylococcus | Treated | 0 | 0.0190 | 0.006 |
| genus | Staphylococcus | Control | 0 | 0.0189 | 0.011 |
| genus | Ruminococcaceae UCG-005 | Control | 21 | 0.0187 | 0.011 |
| genus | [Eubacterium] coprostanoligenes group | Treated | 28 | 0.0185 | 0.009 |
| genus | Methylobacterium | Control | 0 | 0.0184 | 0.014 |
| genus | Psychrobacter | Control | 21 | 0.0183 | 0.009 |
| genus | Ruminococcaceae UCG-010 | Control | 28 | 0.0177 | 0.016 |
| genus | Ruminococcaceae UCG-005 | Control | 28 | 0.0176 | 0.018 |
| genus | Streptococcus | Control | 28 | 0.0176 | 0.013 |
| genus | Rikenellaceae RC9 gut group | Control | 8 | 0.0174 | 0.007 |
| genus | [Eubacterium] coprostanoligenes group | Treated | 8 | 0.0169 | 0.008 |
| genus | Ruminococcaceae UCG-010 | Control | 21 | 0.0169 | 0.018 |
| genus | Christensenellaceae R-7 group | Treated | 8 | 0.0166 | 0.013 |
| genus | Bacteroides | Treated | 21 | 0.0165 | 0.010 |
| genus | Bacteroides | Treated | 0 | 0.0164 | 0.006 |
| genus | Prevotella 1 | Treated | 8 | 0.0164 | 0.007 |
| genus | Corynebacterium 1 | Control | 21 | 0.0163 | 0.010 |
| genus | Corynebacterium 1 | Treated | 8 | 0.0161 | 0.007 |
| genus | Prevotella 1 | Control | 21 | 0.0161 | 0.009 |
| genus | Ruminococcaceae UCG-013 | Treated | 21 | 0.0161 | 0.015 |
| genus | Prevotella 1 | Treated | 0 | 0.0157 | 0.008 |
| genus | Streptococcus | Control | 21 | 0.0157 | 0.010 |
| genus | Corynebacterium 1 | Control | 8 | 0.0154 | 0.012 |
| genus | Rikenellaceae RC9 gut group | Treated | 8 | 0.0148 | 0.008 |
| genus | Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium | Control | 28 | 0.0144 | 0.014 |
| genus | Prevotella 1 | Control | 0 | 0.0143 | 0.006 |
| genus | Prevotella 1 | Treated | 28 | 0.0140 | 0.004 |
| genus | Corynebacterium 1 | Treated | 0 | 0.0139 | 0.003 |
| genus | Ruminococcaceae UCG-014 | Control | 0 | 0.0138 | 0.012 |
| genus | Lachnospiraceae NK3A20 group | Treated | 0 | 0.0137 | 0.004 |
| genus | Bacillus | Control | 21 | 0.0136 | 0.009 |
| genus | Lachnospiraceae NK3A20 group | Treated | 8 | 0.0133 | 0.005 |
| genus | Corynebacterium 1 | Treated | 28 | 0.0132 | 0.007 |
| genus | Rikenellaceae RC9 gut group | Control | 28 | 0.0132 | 0.010 |
| genus | Bacteroides | Control | 8 | 0.0130 | 0.014 |
| genus | Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium | Control | 21 | 0.0125 | 0.011 |
| genus | Acinetobacter | Treated | 8 | 0.0123 | 0.014 |
| genus | Bacteroides | Treated | 8 | 0.0121 | 0.005 |
| genus | Lachnospiraceae NK3A20 group | Control | 0 | 0.0121 | 0.003 |
| genus | Corynebacterium 1 | Control | 28 | 0.0120 | 0.007 |
| genus | Flavobacterium | Control | 21 | 0.0120 | 0.012 |
| genus | Lactobacillus | Treated | 28 | 0.0120 | 0.008 |
| genus | Christensenellaceae R-7 group | Control | 21 | 0.0117 | 0.011 |
| genus | Lachnospiraceae NK3A20 group | Treated | 28 | 0.0117 | 0.007 |
| genus | Acinetobacter | Treated | 0 | 0.0116 | 0.004 |
| genus | Bacillus | Treated | 21 | 0.0116 | 0.005 |
| genus | Bacillus | Treated | 8 | 0.0113 | 0.007 |
| genus | Lachnospiraceae NK3A20 group | Control | 8 | 0.0113 | 0.006 |
| genus | Rikenellaceae RC9 gut group | Control | 21 | 0.0113 | 0.006 |
| genus | Sphingomonas | Control | 21 | 0.0113 | 0.008 |
| genus | Corynebacterium 1 | Control | 0 | 0.0112 | 0.008 |
| genus | [Eubacterium] coprostanoligenes group | Control | 8 | 0.0111 | 0.011 |
| genus | Acinetobacter | Control | 8 | 0.0110 | 0.005 |
| genus | Bacteroides | Treated | 28 | 0.0106 | 0.007 |
| genus | Shewanella | Control | 28 | 0.0106 | 0.005 |
| genus | Acinetobacter | Treated | 28 | 0.0105 | 0.005 |
| genus | Acinetobacter | Control | 21 | 0.0104 | 0.005 |
| genus | Clostridium sensu stricto 1 | Treated | 0 | 0.0104 | 0.006 |
| genus | [Eubacterium] coprostanoligenes group | Control | 21 | 0.0103 | 0.006 |
| genus | Achromobacter | Control | 28 | 0.0102 | 0.006 |
| order | Clostridiales | Control | 0 | 0.3586 | 0.158 |
| order | Clostridiales | Treated | 21 | 0.2907 | 0.161 |
| order | Clostridiales | Treated | 0 | 0.2875 | 0.092 |
| order | Clostridiales | Control | 8 | 0.2556 | 0.132 |
| order | Clostridiales | Treated | 28 | 0.2475 | 0.086 |
| order | Clostridiales | Treated | 8 | 0.2414 | 0.118 |
| order | Pseudomonadales | Control | 28 | 0.1931 | 0.065 |
| order | Clostridiales | Control | 21 | 0.1766 | 0.084 |
| order | Clostridiales | Control | 28 | 0.1437 | 0.102 |
| order | Bacteroidales | Control | 0 | 0.1207 | 0.024 |
| order | Bacteroidales | Treated | 21 | 0.1176 | 0.042 |
| order | Pseudomonadales | Control | 21 | 0.1169 | 0.051 |
| order | Pseudomonadales | Treated | 28 | 0.1128 | 0.075 |
| order | Bacteroidales | Treated | 0 | 0.1111 | 0.024 |
| order | Pseudomonadales | Control | 8 | 0.1074 | 0.067 |
| order | Rhizobiales | Control | 28 | 0.1032 | 0.054 |
| order | Bacteroidales | Control | 8 | 0.1028 | 0.024 |
| order | Bacteroidales | Treated | 28 | 0.0992 | 0.039 |
| order | Bacteroidales | Treated | 8 | 0.0977 | 0.034 |
| order | Pseudomonadales | Treated | 8 | 0.0956 | 0.063 |
| order | Pseudomonadales | Treated | 0 | 0.0948 | 0.031 |
| order | Rhizobiales | Control | 21 | 0.0853 | 0.041 |
| order | Pseudomonadales | Control | 0 | 0.0823 | 0.038 |
| order | Propionibacteriales | Control | 28 | 0.0811 | 0.029 |
| order | Pseudomonadales | Treated | 21 | 0.0773 | 0.051 |
| order | Bacteroidales | Control | 21 | 0.0700 | 0.018 |
| order | Bacillales | Treated | 8 | 0.0693 | 0.016 |
| order | Bacteroidales | Control | 28 | 0.0682 | 0.047 |
| order | Bacillales | Control | 8 | 0.0665 | 0.047 |
| order | Rhizobiales | Treated | 28 | 0.0619 | 0.048 |
| order | Rhizobiales | Treated | 8 | 0.0611 | 0.035 |
| order | Rhizobiales | Control | 8 | 0.0609 | 0.042 |
| order | Lactobacillales | Treated | 28 | 0.0604 | 0.018 |
| order | Lactobacillales | Treated | 0 | 0.0596 | 0.013 |
| order | Lactobacillales | Control | 8 | 0.0579 | 0.026 |
| order | Micrococcales | Treated | 8 | 0.0550 | 0.018 |
| order | Propionibacteriales | Control | 21 | 0.0550 | 0.018 |
| order | Oceanospirillales | Control | 28 | 0.0544 | 0.022 |
| order | Lactobacillales | Treated | 8 | 0.0534 | 0.017 |
| order | Micrococcales | Control | 21 | 0.0530 | 0.015 |
| order | Micrococcales | Treated | 0 | 0.0524 | 0.013 |
| order | Micrococcales | Control | 28 | 0.0519 | 0.022 |
| order | Micrococcales | Treated | 28 | 0.0506 | 0.017 |
| order | Lactobacillales | Treated | 21 | 0.0500 | 0.029 |
| order | Propionibacteriales | Treated | 28 | 0.0499 | 0.017 |
| order | Bacillales | Control | 21 | 0.0497 | 0.009 |
| order | Bacillales | Control | 28 | 0.0493 | 0.026 |
| order | Lactobacillales | Control | 0 | 0.0491 | 0.028 |
| order | Rhizobiales | Treated | 21 | 0.0484 | 0.030 |
| order | Bacillales | Treated | 28 | 0.0475 | 0.018 |
| order | Bacillales | Treated | 0 | 0.0465 | 0.014 |
| order | Bacillales | Treated | 21 | 0.0452 | 0.014 |
| order | Propionibacteriales | Treated | 0 | 0.0442 | 0.015 |
| order | Propionibacteriales | Control | 8 | 0.0431 | 0.020 |
| order | Micrococcales | Control | 8 | 0.0429 | 0.016 |
| order | Propionibacteriales | Control | 0 | 0.0427 | 0.028 |
| order | Propionibacteriales | Treated | 8 | 0.0409 | 0.019 |
| order | Micrococcales | Treated | 21 | 0.0401 | 0.022 |
| order | Micrococcales | Control | 0 | 0.0399 | 0.023 |
| order | Rhizobiales | Control | 0 | 0.0387 | 0.030 |
| order | Rhizobiales | Treated | 0 | 0.0384 | 0.029 |
| order | Lactobacillales | Control | 21 | 0.0380 | 0.018 |
| order | Bacillales | Control | 0 | 0.0374 | 0.017 |
| order | Lactobacillales | Control | 28 | 0.0363 | 0.025 |
| order | Oceanospirillales | Control | 21 | 0.0340 | 0.016 |
| order | Oceanospirillales | Control | 8 | 0.0331 | 0.024 |
| order | Corynebacteriales | Control | 21 | 0.0324 | 0.013 |
| order | Oceanospirillales | Treated | 28 | 0.0319 | 0.023 |
| order | Propionibacteriales | Treated | 21 | 0.0292 | 0.016 |
| order | Corynebacteriales | Treated | 8 | 0.0285 | 0.012 |
| order | Betaproteobacteriales | Control | 21 | 0.0279 | 0.013 |
| order | Oceanospirillales | Treated | 8 | 0.0278 | 0.020 |
| order | Corynebacteriales | Treated | 28 | 0.0270 | 0.008 |
| order | Corynebacteriales | Control | 28 | 0.0255 | 0.011 |
| order | Sphingomonadales | Control | 21 | 0.0253 | 0.012 |
| order | Corynebacteriales | Control | 8 | 0.0251 | 0.016 |
| order | Alteromonadales | Control | 28 | 0.0250 | 0.008 |
| order | Corynebacteriales | Treated | 0 | 0.0239 | 0.007 |
| order | Oceanospirillales | Treated | 0 | 0.0236 | 0.007 |
| order | Oceanospirillales | Control | 0 | 0.0225 | 0.010 |
| order | Oceanospirillales | Treated | 21 | 0.0225 | 0.016 |
| order | Flavobacteriales | Control | 21 | 0.0212 | 0.013 |
| order | Alteromonadales | Treated | 28 | 0.0209 | 0.006 |
| order | Alteromonadales | Treated | 0 | 0.0186 | 0.006 |
| order | Sphingomonadales | Treated | 8 | 0.0182 | 0.013 |
| order | Corynebacteriales | Control | 0 | 0.0176 | 0.011 |
| order | Betaproteobacteriales | Control | 28 | 0.0175 | 0.009 |
| order | Alteromonadales | Control | 8 | 0.0163 | 0.005 |
| order | Corynebacteriales | Treated | 21 | 0.0157 | 0.006 |
| order | Betaproteobacteriales | Treated | 21 | 0.0155 | 0.012 |
| order | Sphingomonadales | Treated | 21 | 0.0154 | 0.016 |
| order | Alteromonadales | Control | 0 | 0.0151 | 0.007 |
| order | Alteromonadales | Treated | 8 | 0.0151 | 0.008 |
| order | Flavobacteriales | Treated | 0 | 0.0151 | 0.002 |
| order | Flavobacteriales | Treated | 21 | 0.0149 | 0.015 |
| order | Alteromonadales | Treated | 21 | 0.0136 | 0.012 |
| order | Aeromonadales | Treated | 28 | 0.0131 | 0.004 |
| order | Alteromonadales | Control | 21 | 0.0129 | 0.006 |
| order | Betaproteobacteriales | Control | 8 | 0.0125 | 0.012 |
| order | Betaproteobacteriales | Treated | 8 | 0.0124 | 0.006 |
| order | Sphingomonadales | Control | 8 | 0.0121 | 0.006 |
| order | Sphingomonadales | Control | 28 | 0.0121 | 0.009 |
| order | Flavobacteriales | Treated | 28 | 0.0118 | 0.005 |
| order | Sphingomonadales | Treated | 0 | 0.0118 | 0.014 |
| order | Xanthomonadales | Control | 21 | 0.0118 | 0.005 |
| order | Flavobacteriales | Control | 0 | 0.0113 | 0.006 |
| order | Flavobacteriales | Treated | 8 | 0.0110 | 0.003 |
| order | Aeromonadales | Treated | 0 | 0.0109 | 0.004 |
| order | Erysipelotrichales | Control | 8 | 0.0104 | 0.004 |
| order | Aeromonadales | Control | 28 | 0.0103 | 0.004 |
| order | Aeromonadales | Control | 0 | 0.0102 | 0.006 |
| order | Betaproteobacteriales | Treated | 28 | 0.0101 | 0.009 |
| phylum | Firmicutes | Control | 0 | 0.4610 | 0.127 |
| phylum | Proteobacteria | Control | 28 | 0.4594 | 0.161 |
| phylum | Firmicutes | Treated | 0 | 0.4081 | 0.087 |
| phylum | Firmicutes | Treated | 21 | 0.4007 | 0.147 |
| phylum | Firmicutes | Control | 8 | 0.3945 | 0.129 |
| phylum | Firmicutes | Treated | 8 | 0.3781 | 0.123 |
| phylum | Firmicutes | Treated | 28 | 0.3689 | 0.108 |
| phylum | Proteobacteria | Control | 21 | 0.3559 | 0.111 |
| phylum | Proteobacteria | Treated | 28 | 0.3000 | 0.164 |
| phylum | Proteobacteria | Control | 8 | 0.2911 | 0.147 |
| phylum | Proteobacteria | Treated | 8 | 0.2855 | 0.147 |
| phylum | Firmicutes | Control | 21 | 0.2753 | 0.090 |
| phylum | Proteobacteria | Treated | 0 | 0.2507 | 0.079 |
| phylum | Proteobacteria | Treated | 21 | 0.2458 | 0.127 |
| phylum | Firmicutes | Control | 28 | 0.2414 | 0.119 |
| phylum | Proteobacteria | Control | 0 | 0.2176 | 0.104 |
| phylum | Actinobacteria | Control | 21 | 0.1785 | 0.029 |
| phylum | Actinobacteria | Control | 28 | 0.1785 | 0.045 |
| phylum | Actinobacteria | Treated | 8 | 0.1577 | 0.039 |
| phylum | Actinobacteria | Treated | 28 | 0.1540 | 0.021 |
| phylum | Bacteroidetes | Treated | 21 | 0.1487 | 0.025 |
| phylum | Actinobacteria | Treated | 0 | 0.1438 | 0.033 |
| phylum | Actinobacteria | Control | 8 | 0.1344 | 0.049 |
| phylum | Bacteroidetes | Control | 0 | 0.1341 | 0.023 |
| phylum | Bacteroidetes | Treated | 0 | 0.1308 | 0.021 |
| phylum | Actinobacteria | Control | 0 | 0.1225 | 0.059 |
| phylum | Actinobacteria | Treated | 21 | 0.1149 | 0.038 |
| phylum | Bacteroidetes | Control | 8 | 0.1148 | 0.026 |
| phylum | Bacteroidetes | Treated | 8 | 0.1147 | 0.035 |
| phylum | Bacteroidetes | Treated | 28 | 0.1135 | 0.044 |
| phylum | Bacteroidetes | Control | 21 | 0.1120 | 0.035 |
| phylum | Bacteroidetes | Control | 28 | 0.0766 | 0.050 |
| phylum | Cyanobacteria | Treated | 28 | 0.0146 | 0.003 |
| phylum | Acidobacteria | Control | 21 | 0.0142 | 0.009 |
| phylum | Acidobacteria | Treated | 21 | 0.0128 | 0.022 |
| phylum | Cyanobacteria | Treated | 0 | 0.0113 | 0.005 |
| phylum | Planctomycetes | Treated | 21 | 0.0103 | 0.018 |
##Class
Dclass <- D %>%
filter(level=="class")
p <- ggplot(Dclass, aes(x=factor(1), y=avg_abund, fill=new_taxa)) + geom_bar(width=1,stat="identity", position = "fill")
p <- p + facet_grid(timepoint~treatment)
p <- p + guides(fill = guide_legend(title = "Class"))
p <- p + geom_label_repel(aes(label = paste0(avg_abund*100, "%")), position=position_stack (vjust=0.5), size=4, show.legend = F)
my_palette = get_palette(c("green3","gold","blue","magenta","cyan","yellow","red","gray","purple", "darkorange1","pink1", "darkorchid1", "seagreen2"), length(unique(Dclass$new_taxa)))
p <- p + xlab("relative abundances") + ylab("percentages")
p <- p + scale_fill_manual(values = my_palette)
p <- p + theme(text = element_text(size=10),
axis.text.x = element_text(size=8),
# axis.text.y = element_text(size=4),
strip.text = element_text(size = 8),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
legend.text=element_text(size=10),
legend.title=element_text(size=10))
print(p)
#ggsave(p, height = 8, width = 8, filename ="taxonomy_class_bargraph_milk.png")
##Family
Dfamily <- D %>%
filter(level=="family")
p <- ggplot(Dfamily, aes(x=factor(1), y=avg_abund, fill=new_taxa)) + geom_bar(width=1,stat="identity", position = "fill")
p <- p + facet_grid(timepoint~treatment)
p <- p + guides(fill = guide_legend(title = "Family"))
#p <- p + geom_label_repel(aes(label = paste0(avg_abund*100, "%")), position=position_stack (vjust=0.5), size=4, show.legend = F)
my_palette2 = get_palette(c("green3","gold","blue","magenta","cyan","yellow","red","gray","purple","brown","black", "darkorange1","pink1", "darkorchid1", "seagreen2", "darkmagenta", "burlywood1", "maroon", "darkred", "burlywood3", "chartreuse4", "coral", "peachpuff", "mediumorchid3", "yellow3", "turquoise4", "snow", "slategray3", "orangered", "olivedrab", "plum", "lightcyan", "gray38", "forestgreen", "firebrick1"), length(unique(Dfamily$new_taxa)))
p <- p + xlab("relative abundances") + ylab("percentages")
p <- p + scale_fill_manual(values = my_palette2)
p <- p + theme(text = element_text(size=10),
axis.text.x = element_text(size=8),
# axis.text.y = element_text(size=4),
strip.text = element_text(size = 8),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
legend.text=element_text(size=10),
legend.title=element_text(size=10))
p
#ggsave(p, height = 8, width = 8, filename ="taxonomy_family_bargraph_MILK.png")
Dgenera <- D %>%
filter(level=="genus")
p <- ggplot(Dgenera, aes(x=factor(1), y=avg_abund, fill=new_taxa)) + geom_bar(width=1,stat="identity", position = "fill")
p <- p + facet_grid(timepoint~treatment)
p <- p + guides(fill = guide_legend(title = "Genera"))
my_palette2 = get_palette(c("green3","gold","blue","magenta","cyan","yellow","red","gray","purple","brown","black", "darkorange1","pink1", "darkorchid1", "seagreen2", "darkmagenta", "burlywood1", "maroon", "darkred", "burlywood3", "chartreuse4", "coral", "peachpuff", "mediumorchid3", "yellow3", "turquoise4", "snow", "slategray3", "orangered", "olivedrab", "plum", "lightcyan", "gray38", "forestgreen", "firebrick1"), length(unique(Dgenera$new_taxa)))
p <- p + xlab("relative abundances") + ylab("percentages")
p <- p + scale_fill_manual(values = my_palette2)
p <- p + theme(text = element_text(size=10),
axis.text.x = element_text(size=8),
# axis.text.y = element_text(size=4),
strip.text = element_text(size = 8),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
legend.text=element_text(size=5),
legend.title=element_text(size=5))
print(p)
#ggsave(p, height = 8, width = 8, filename ="taxonomy_genera_bargraph_MILK.png")
##Order
Dorder <- D %>%
filter(level=="order")
p <- ggplot(Dorder, aes(x=factor(1), y=avg_abund, fill=new_taxa)) + geom_bar(width=1,stat="identity", position = "fill")
p <- p + facet_grid(timepoint~treatment)
p <- p + guides(fill = guide_legend(title = "Order"))
my_palette2 = get_palette(c("red","darkred", "burlywood3", "chartreuse4","gray","gold","blue","magenta","cyan","purple","green3","yellow","brown","black", "darkorange1","pink1", "darkorchid1", "seagreen2", "darkmagenta", "burlywood1", "maroon", "coral", "peachpuff", "mediumorchid3", "yellow3", "turquoise4", "snow", "slategray3", "orangered", "olivedrab", "plum", "lightcyan", "gray38", "forestgreen", "firebrick1"), length(unique(Dorder$new_taxa)))
p <- p + xlab("relative abundances") + ylab("percentages")
p <- p + scale_fill_manual(values = my_palette2)
p <- p + theme(text = element_text(size=10),
axis.text.x = element_text(size=8),
# axis.text.y = element_text(size=4),
strip.text = element_text(size = 8),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
legend.text=element_text(size=10),
legend.title=element_text(size=10))
print(p)
#ggsave(p, height = 8, width = 8, filename ="taxonomy_order_bargraph_MILK.png")
##Phylum
Dphylum <- D %>%
filter(level=="phylum")
p <- ggplot(Dphylum, aes(x=factor(1), y=avg_abund, fill=new_taxa)) + geom_bar(width=1,stat="identity", position = "fill")
p <- p + facet_grid(timepoint~treatment)
p <- p + guides(fill = guide_legend(title = "Phylum"))
p <- p + geom_label_repel(aes(label = paste0(avg_abund*100, "%")), position=position_stack (vjust=0.5), size=4, show.legend = F)
my_palette3 = get_palette(c("red", "green3","yellow","darkmagenta", "gray","lightcyan", "gold","blue"), length(unique(Dphylum$new_taxa)))
p <- p + xlab("relative abundances") + ylab("percentages")
p <- p + scale_fill_manual(values = my_palette3)
p <- p + theme(text = element_text(size=10),
axis.text.x = element_text(size=8),
# axis.text.y = element_text(size=4),
strip.text = element_text(size = 8),
axis.text.y = element_blank(),
axis.ticks.y = element_blank(),
legend.text=element_text(size=10),
legend.title=element_text(size=10))
print(p)
#ggsave(p, height = 8, width = 8, filename ="taxonomy_phylum_bargraph_MILK.png")
Same results, but in wide-format (treatments on the horizontal axis): relative abundances (no standard deviations):
| level | new_taxa | timepoint | Control | Treated |
|---|---|---|---|---|
| phylum | Acidobacteria | 21 | 0.0142 | 0.0128 |
| phylum | Actinobacteria | 0 | 0.1225 | 0.1438 |
| phylum | Actinobacteria | 8 | 0.1344 | 0.1577 |
| phylum | Actinobacteria | 21 | 0.1785 | 0.1149 |
| phylum | Actinobacteria | 28 | 0.1785 | 0.1540 |
| phylum | Bacteroidetes | 0 | 0.1341 | 0.1308 |
| phylum | Bacteroidetes | 8 | 0.1148 | 0.1147 |
| phylum | Bacteroidetes | 21 | 0.1120 | 0.1487 |
| phylum | Bacteroidetes | 28 | 0.0766 | 0.1135 |
| phylum | Cyanobacteria | 0 | NA | 0.0113 |
| phylum | Cyanobacteria | 28 | NA | 0.0146 |
| phylum | Firmicutes | 0 | 0.4610 | 0.4081 |
| phylum | Firmicutes | 8 | 0.3945 | 0.3781 |
| phylum | Firmicutes | 21 | 0.2753 | 0.4007 |
| phylum | Firmicutes | 28 | 0.2414 | 0.3689 |
| phylum | Planctomycetes | 21 | NA | 0.0103 |
| phylum | Proteobacteria | 0 | 0.2176 | 0.2507 |
| phylum | Proteobacteria | 8 | 0.2911 | 0.2855 |
| phylum | Proteobacteria | 21 | 0.3559 | 0.2458 |
| phylum | Proteobacteria | 28 | 0.4594 | 0.3000 |
| class | Actinobacteria | 0 | 0.1109 | 0.1334 |
| class | Actinobacteria | 8 | 0.1237 | 0.1444 |
| class | Actinobacteria | 21 | 0.1590 | 0.1008 |
| class | Actinobacteria | 28 | 0.1734 | 0.1416 |
| class | Alphaproteobacteria | 0 | 0.0599 | 0.0649 |
| class | Alphaproteobacteria | 8 | 0.0915 | 0.0995 |
| class | Alphaproteobacteria | 21 | 0.1331 | 0.0810 |
| class | Alphaproteobacteria | 28 | 0.1358 | 0.0857 |
| class | Bacilli | 0 | 0.0864 | 0.1061 |
| class | Bacilli | 8 | 0.1244 | 0.1227 |
| class | Bacilli | 21 | 0.0877 | 0.0952 |
| class | Bacilli | 28 | 0.0856 | 0.1079 |
| class | Bacteroidia | 0 | 0.1341 | 0.1308 |
| class | Bacteroidia | 8 | 0.1148 | 0.1147 |
| class | Bacteroidia | 21 | 0.1120 | 0.1487 |
| class | Bacteroidia | 28 | 0.0766 | 0.1135 |
| class | Clostridia | 0 | 0.3587 | 0.2875 |
| class | Clostridia | 8 | 0.2556 | 0.2419 |
| class | Clostridia | 21 | 0.1766 | 0.2907 |
| class | Clostridia | 28 | 0.1438 | 0.2478 |
| class | Erysipelotrichia | 8 | 0.0104 | NA |
| class | Gammaproteobacteria | 0 | 0.1545 | 0.1826 |
| class | Gammaproteobacteria | 8 | 0.1972 | 0.1801 |
| class | Gammaproteobacteria | 21 | 0.2209 | 0.1602 |
| class | Gammaproteobacteria | 28 | 0.3224 | 0.2116 |
| order | Aeromonadales | 0 | 0.0102 | 0.0109 |
| order | Aeromonadales | 28 | 0.0103 | 0.0131 |
| order | Alteromonadales | 0 | 0.0151 | 0.0186 |
| order | Alteromonadales | 8 | 0.0163 | 0.0151 |
| order | Alteromonadales | 21 | 0.0129 | 0.0136 |
| order | Alteromonadales | 28 | 0.0250 | 0.0209 |
| order | Bacillales | 0 | 0.0374 | 0.0465 |
| order | Bacillales | 8 | 0.0665 | 0.0693 |
| order | Bacillales | 21 | 0.0497 | 0.0452 |
| order | Bacillales | 28 | 0.0493 | 0.0475 |
| order | Bacteroidales | 0 | 0.1207 | 0.1111 |
| order | Bacteroidales | 8 | 0.1028 | 0.0977 |
| order | Bacteroidales | 21 | 0.0700 | 0.1176 |
| order | Bacteroidales | 28 | 0.0682 | 0.0992 |
| order | Betaproteobacteriales | 8 | 0.0125 | 0.0124 |
| order | Betaproteobacteriales | 21 | 0.0279 | 0.0155 |
| order | Betaproteobacteriales | 28 | 0.0175 | 0.0101 |
| order | Clostridiales | 0 | 0.3586 | 0.2875 |
| order | Clostridiales | 8 | 0.2556 | 0.2414 |
| order | Clostridiales | 21 | 0.1766 | 0.2907 |
| order | Clostridiales | 28 | 0.1437 | 0.2475 |
| order | Corynebacteriales | 0 | 0.0176 | 0.0239 |
| order | Corynebacteriales | 8 | 0.0251 | 0.0285 |
| order | Corynebacteriales | 21 | 0.0324 | 0.0157 |
| order | Corynebacteriales | 28 | 0.0255 | 0.0270 |
| order | Erysipelotrichales | 8 | 0.0104 | NA |
| order | Flavobacteriales | 0 | 0.0113 | 0.0151 |
| order | Flavobacteriales | 8 | NA | 0.0110 |
| order | Flavobacteriales | 21 | 0.0212 | 0.0149 |
| order | Flavobacteriales | 28 | NA | 0.0118 |
| order | Lactobacillales | 0 | 0.0491 | 0.0596 |
| order | Lactobacillales | 8 | 0.0579 | 0.0534 |
| order | Lactobacillales | 21 | 0.0380 | 0.0500 |
| order | Lactobacillales | 28 | 0.0363 | 0.0604 |
| order | Micrococcales | 0 | 0.0399 | 0.0524 |
| order | Micrococcales | 8 | 0.0429 | 0.0550 |
| order | Micrococcales | 21 | 0.0530 | 0.0401 |
| order | Micrococcales | 28 | 0.0519 | 0.0506 |
| order | Oceanospirillales | 0 | 0.0225 | 0.0236 |
| order | Oceanospirillales | 8 | 0.0331 | 0.0278 |
| order | Oceanospirillales | 21 | 0.0340 | 0.0225 |
| order | Oceanospirillales | 28 | 0.0544 | 0.0319 |
| order | Propionibacteriales | 0 | 0.0427 | 0.0442 |
| order | Propionibacteriales | 8 | 0.0431 | 0.0409 |
| order | Propionibacteriales | 21 | 0.0550 | 0.0292 |
| order | Propionibacteriales | 28 | 0.0811 | 0.0499 |
| order | Pseudomonadales | 0 | 0.0823 | 0.0948 |
| order | Pseudomonadales | 8 | 0.1074 | 0.0956 |
| order | Pseudomonadales | 21 | 0.1169 | 0.0773 |
| order | Pseudomonadales | 28 | 0.1931 | 0.1128 |
| order | Rhizobiales | 0 | 0.0387 | 0.0384 |
| order | Rhizobiales | 8 | 0.0609 | 0.0611 |
| order | Rhizobiales | 21 | 0.0853 | 0.0484 |
| order | Rhizobiales | 28 | 0.1032 | 0.0619 |
| order | Sphingomonadales | 0 | NA | 0.0118 |
| order | Sphingomonadales | 8 | 0.0121 | 0.0182 |
| order | Sphingomonadales | 21 | 0.0253 | 0.0154 |
| order | Sphingomonadales | 28 | 0.0121 | NA |
| order | Xanthomonadales | 21 | 0.0118 | NA |
| family | Bacillaceae | 8 | 0.0104 | 0.0159 |
| family | Bacillaceae | 21 | 0.0151 | 0.0132 |
| family | Bacteroidaceae | 0 | 0.0205 | 0.0164 |
| family | Bacteroidaceae | 8 | 0.0130 | 0.0121 |
| family | Bacteroidaceae | 21 | NA | 0.0165 |
| family | Bacteroidaceae | 28 | NA | 0.0106 |
| family | Beijerinckiaceae | 0 | 0.0236 | 0.0246 |
| family | Beijerinckiaceae | 8 | 0.0459 | 0.0424 |
| family | Beijerinckiaceae | 21 | 0.0453 | 0.0252 |
| family | Beijerinckiaceae | 28 | 0.0675 | 0.0345 |
| family | Burkholderiaceae | 8 | 0.0118 | 0.0117 |
| family | Burkholderiaceae | 21 | 0.0230 | 0.0118 |
| family | Burkholderiaceae | 28 | 0.0165 | NA |
| family | Carnobacteriaceae | 0 | 0.0132 | 0.0178 |
| family | Carnobacteriaceae | 8 | 0.0131 | 0.0135 |
| family | Carnobacteriaceae | 21 | NA | 0.0132 |
| family | Carnobacteriaceae | 28 | NA | 0.0132 |
| family | Christensenellaceae | 0 | 0.0312 | 0.0261 |
| family | Christensenellaceae | 8 | 0.0229 | 0.0166 |
| family | Christensenellaceae | 21 | 0.0117 | 0.0242 |
| family | Christensenellaceae | 28 | NA | 0.0202 |
| family | Clostridiaceae 1 | 0 | NA | 0.0119 |
| family | Clostridiaceae 1 | 8 | 0.0103 | NA |
| family | Corynebacteriaceae | 0 | 0.0153 | 0.0194 |
| family | Corynebacteriaceae | 8 | 0.0207 | 0.0214 |
| family | Corynebacteriaceae | 21 | 0.0239 | 0.0106 |
| family | Corynebacteriaceae | 28 | 0.0201 | 0.0190 |
| family | Erysipelotrichaceae | 8 | 0.0104 | NA |
| family | Family XIII | 0 | 0.0130 | 0.0108 |
| family | Flavobacteriaceae | 0 | NA | 0.0109 |
| family | Flavobacteriaceae | 21 | 0.0156 | 0.0129 |
| family | Halomonadaceae | 0 | 0.0217 | 0.0226 |
| family | Halomonadaceae | 8 | 0.0324 | 0.0258 |
| family | Halomonadaceae | 21 | 0.0329 | 0.0216 |
| family | Halomonadaceae | 28 | 0.0514 | 0.0303 |
| family | Lachnospiraceae | 0 | 0.0734 | 0.0626 |
| family | Lachnospiraceae | 8 | 0.0598 | 0.0558 |
| family | Lachnospiraceae | 21 | 0.0423 | 0.0590 |
| family | Lachnospiraceae | 28 | 0.0317 | 0.0582 |
| family | Lactobacillaceae | 28 | NA | 0.0120 |
| family | Microbacteriaceae | 21 | 0.0124 | NA |
| family | Micrococcaceae | 0 | 0.0287 | 0.0348 |
| family | Micrococcaceae | 8 | 0.0287 | 0.0338 |
| family | Micrococcaceae | 21 | 0.0239 | 0.0235 |
| family | Micrococcaceae | 28 | 0.0348 | 0.0352 |
| family | Moraxellaceae | 0 | 0.0369 | 0.0441 |
| family | Moraxellaceae | 8 | 0.0405 | 0.0363 |
| family | Moraxellaceae | 21 | 0.0344 | 0.0275 |
| family | Moraxellaceae | 28 | 0.0522 | 0.0456 |
| family | Nocardioidaceae | 21 | 0.0154 | NA |
| family | Peptostreptococcaceae | 0 | 0.0146 | 0.0187 |
| family | Peptostreptococcaceae | 8 | 0.0159 | 0.0197 |
| family | Peptostreptococcaceae | 21 | 0.0168 | 0.0136 |
| family | Peptostreptococcaceae | 28 | NA | 0.0204 |
| family | Prevotellaceae | 0 | 0.0354 | 0.0371 |
| family | Prevotellaceae | 8 | 0.0364 | 0.0322 |
| family | Prevotellaceae | 21 | 0.0260 | 0.0427 |
| family | Prevotellaceae | 28 | 0.0272 | 0.0333 |
| family | Propionibacteriaceae | 0 | 0.0379 | 0.0389 |
| family | Propionibacteriaceae | 8 | 0.0379 | 0.0359 |
| family | Propionibacteriaceae | 21 | 0.0396 | 0.0234 |
| family | Propionibacteriaceae | 28 | 0.0759 | 0.0445 |
| family | Pseudomonadaceae | 0 | 0.0454 | 0.0507 |
| family | Pseudomonadaceae | 8 | 0.0668 | 0.0593 |
| family | Pseudomonadaceae | 21 | 0.0825 | 0.0497 |
| family | Pseudomonadaceae | 28 | 0.1409 | 0.0672 |
| family | Rhizobiaceae | 0 | 0.0105 | NA |
| family | Rhizobiaceae | 8 | NA | 0.0110 |
| family | Rhizobiaceae | 21 | 0.0248 | 0.0152 |
| family | Rhizobiaceae | 28 | 0.0268 | 0.0174 |
| family | Rikenellaceae | 0 | 0.0345 | 0.0329 |
| family | Rikenellaceae | 8 | 0.0256 | 0.0247 |
| family | Rikenellaceae | 21 | 0.0173 | 0.0322 |
| family | Rikenellaceae | 28 | 0.0188 | 0.0311 |
| family | Ruminococcaceae | 0 | 0.2013 | 0.1397 |
| family | Ruminococcaceae | 8 | 0.1210 | 0.1189 |
| family | Ruminococcaceae | 21 | 0.0813 | 0.1613 |
| family | Ruminococcaceae | 28 | 0.0757 | 0.1167 |
| family | Shewanellaceae | 28 | 0.0119 | NA |
| family | Sphingomonadaceae | 0 | NA | 0.0118 |
| family | Sphingomonadaceae | 8 | 0.0121 | 0.0182 |
| family | Sphingomonadaceae | 21 | 0.0253 | 0.0154 |
| family | Sphingomonadaceae | 28 | 0.0121 | NA |
| family | Staphylococcaceae | 0 | 0.0207 | 0.0224 |
| family | Staphylococcaceae | 8 | 0.0438 | 0.0411 |
| family | Staphylococcaceae | 21 | 0.0261 | 0.0228 |
| family | Staphylococcaceae | 28 | 0.0316 | 0.0273 |
| family | Streptococcaceae | 0 | 0.0256 | 0.0290 |
| family | Streptococcaceae | 8 | 0.0299 | 0.0244 |
| family | Streptococcaceae | 21 | 0.0161 | 0.0226 |
| family | Streptococcaceae | 28 | 0.0181 | 0.0296 |
| family | Xanthobacteraceae | 21 | 0.0118 | NA |
| family | Xanthomonadaceae | 21 | 0.0117 | NA |
| genus | [Eubacterium] coprostanoligenes group | 0 | 0.0219 | 0.0190 |
| genus | [Eubacterium] coprostanoligenes group | 8 | 0.0111 | 0.0169 |
| genus | [Eubacterium] coprostanoligenes group | 21 | 0.0103 | 0.0192 |
| genus | [Eubacterium] coprostanoligenes group | 28 | NA | 0.0185 |
| genus | Achromobacter | 28 | 0.0102 | NA |
| genus | Acinetobacter | 0 | NA | 0.0116 |
| genus | Acinetobacter | 8 | 0.0110 | 0.0123 |
| genus | Acinetobacter | 21 | 0.0104 | NA |
| genus | Acinetobacter | 28 | 0.0221 | 0.0105 |
| genus | Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium | 21 | 0.0125 | NA |
| genus | Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium | 28 | 0.0144 | NA |
| genus | Bacillus | 8 | NA | 0.0113 |
| genus | Bacillus | 21 | 0.0136 | 0.0116 |
| genus | Bacteroides | 0 | 0.0205 | 0.0164 |
| genus | Bacteroides | 8 | 0.0130 | 0.0121 |
| genus | Bacteroides | 21 | NA | 0.0165 |
| genus | Bacteroides | 28 | NA | 0.0106 |
| genus | Christensenellaceae R-7 group | 0 | 0.0308 | 0.0259 |
| genus | Christensenellaceae R-7 group | 8 | 0.0227 | 0.0166 |
| genus | Christensenellaceae R-7 group | 21 | 0.0117 | 0.0241 |
| genus | Christensenellaceae R-7 group | 28 | NA | 0.0202 |
| genus | Clostridium sensu stricto 1 | 0 | NA | 0.0104 |
| genus | Corynebacterium 1 | 0 | 0.0112 | 0.0139 |
| genus | Corynebacterium 1 | 8 | 0.0154 | 0.0161 |
| genus | Corynebacterium 1 | 21 | 0.0163 | NA |
| genus | Corynebacterium 1 | 28 | 0.0120 | 0.0132 |
| genus | Cutibacterium | 0 | 0.0365 | 0.0360 |
| genus | Cutibacterium | 8 | 0.0350 | 0.0307 |
| genus | Cutibacterium | 21 | 0.0361 | 0.0209 |
| genus | Cutibacterium | 28 | 0.0734 | 0.0416 |
| genus | Flavobacterium | 21 | 0.0120 | NA |
| genus | Halomonas | 0 | 0.0211 | 0.0219 |
| genus | Halomonas | 8 | 0.0313 | 0.0251 |
| genus | Halomonas | 21 | 0.0320 | 0.0212 |
| genus | Halomonas | 28 | 0.0511 | 0.0298 |
| genus | Lachnospiraceae NK3A20 group | 0 | 0.0121 | 0.0137 |
| genus | Lachnospiraceae NK3A20 group | 8 | 0.0113 | 0.0133 |
| genus | Lachnospiraceae NK3A20 group | 28 | NA | 0.0117 |
| genus | Lactobacillus | 28 | NA | 0.0120 |
| genus | Methylobacterium | 0 | 0.0184 | 0.0194 |
| genus | Methylobacterium | 8 | 0.0394 | 0.0349 |
| genus | Methylobacterium | 21 | 0.0401 | 0.0219 |
| genus | Methylobacterium | 28 | 0.0603 | 0.0276 |
| genus | Prevotella 1 | 0 | 0.0143 | 0.0157 |
| genus | Prevotella 1 | 8 | 0.0196 | 0.0164 |
| genus | Prevotella 1 | 21 | 0.0161 | 0.0217 |
| genus | Prevotella 1 | 28 | 0.0197 | 0.0140 |
| genus | Pseudomonas | 0 | 0.0453 | 0.0504 |
| genus | Pseudomonas | 8 | 0.0666 | 0.0592 |
| genus | Pseudomonas | 21 | 0.0825 | 0.0495 |
| genus | Pseudomonas | 28 | 0.1405 | 0.0671 |
| genus | Psychrobacter | 0 | 0.0249 | 0.0292 |
| genus | Psychrobacter | 8 | 0.0271 | 0.0232 |
| genus | Psychrobacter | 21 | 0.0183 | 0.0203 |
| genus | Psychrobacter | 28 | 0.0233 | 0.0283 |
| genus | Rikenellaceae RC9 gut group | 0 | 0.0213 | 0.0207 |
| genus | Rikenellaceae RC9 gut group | 8 | 0.0174 | 0.0148 |
| genus | Rikenellaceae RC9 gut group | 21 | 0.0113 | 0.0219 |
| genus | Rikenellaceae RC9 gut group | 28 | 0.0132 | 0.0223 |
| genus | Ruminococcaceae UCG-005 | 0 | 0.0393 | 0.0303 |
| genus | Ruminococcaceae UCG-005 | 8 | 0.0286 | 0.0244 |
| genus | Ruminococcaceae UCG-005 | 21 | 0.0187 | 0.0356 |
| genus | Ruminococcaceae UCG-005 | 28 | 0.0176 | 0.0241 |
| genus | Ruminococcaceae UCG-010 | 0 | 0.0459 | 0.0354 |
| genus | Ruminococcaceae UCG-010 | 8 | 0.0295 | 0.0277 |
| genus | Ruminococcaceae UCG-010 | 21 | 0.0169 | 0.0362 |
| genus | Ruminococcaceae UCG-010 | 28 | 0.0177 | 0.0291 |
| genus | Ruminococcaceae UCG-013 | 0 | 0.0218 | NA |
| genus | Ruminococcaceae UCG-013 | 21 | NA | 0.0161 |
| genus | Ruminococcaceae UCG-014 | 0 | 0.0138 | NA |
| genus | Shewanella | 28 | 0.0106 | NA |
| genus | Sphingomonas | 21 | 0.0113 | NA |
| genus | Staphylococcus | 0 | 0.0189 | 0.0190 |
| genus | Staphylococcus | 8 | 0.0384 | 0.0367 |
| genus | Staphylococcus | 21 | 0.0224 | 0.0194 |
| genus | Staphylococcus | 28 | 0.0272 | 0.0243 |
| genus | Streptococcus | 0 | 0.0254 | 0.0283 |
| genus | Streptococcus | 8 | 0.0298 | 0.0233 |
| genus | Streptococcus | 21 | 0.0157 | 0.0217 |
| genus | Streptococcus | 28 | 0.0176 | 0.0287 |
timepoint
| level | new_taxa | treatment | 0 | 8 | 21 | 28 |
|---|---|---|---|---|---|---|
| phylum | Acidobacteria | Control | NA | NA | 0.0142 | NA |
| phylum | Acidobacteria | Treated | NA | NA | 0.0128 | NA |
| phylum | Actinobacteria | Control | 0.1225 | 0.1344 | 0.1785 | 0.1785 |
| phylum | Actinobacteria | Treated | 0.1438 | 0.1577 | 0.1149 | 0.1540 |
| phylum | Bacteroidetes | Control | 0.1341 | 0.1148 | 0.1120 | 0.0766 |
| phylum | Bacteroidetes | Treated | 0.1308 | 0.1147 | 0.1487 | 0.1135 |
| phylum | Cyanobacteria | Treated | 0.0113 | NA | NA | 0.0146 |
| phylum | Firmicutes | Control | 0.4610 | 0.3945 | 0.2753 | 0.2414 |
| phylum | Firmicutes | Treated | 0.4081 | 0.3781 | 0.4007 | 0.3689 |
| phylum | Planctomycetes | Treated | NA | NA | 0.0103 | NA |
| phylum | Proteobacteria | Control | 0.2176 | 0.2911 | 0.3559 | 0.4594 |
| phylum | Proteobacteria | Treated | 0.2507 | 0.2855 | 0.2458 | 0.3000 |
| class | Actinobacteria | Control | 0.1109 | 0.1237 | 0.1590 | 0.1734 |
| class | Actinobacteria | Treated | 0.1334 | 0.1444 | 0.1008 | 0.1416 |
| class | Alphaproteobacteria | Control | 0.0599 | 0.0915 | 0.1331 | 0.1358 |
| class | Alphaproteobacteria | Treated | 0.0649 | 0.0995 | 0.0810 | 0.0857 |
| class | Bacilli | Control | 0.0864 | 0.1244 | 0.0877 | 0.0856 |
| class | Bacilli | Treated | 0.1061 | 0.1227 | 0.0952 | 0.1079 |
| class | Bacteroidia | Control | 0.1341 | 0.1148 | 0.1120 | 0.0766 |
| class | Bacteroidia | Treated | 0.1308 | 0.1147 | 0.1487 | 0.1135 |
| class | Clostridia | Control | 0.3587 | 0.2556 | 0.1766 | 0.1438 |
| class | Clostridia | Treated | 0.2875 | 0.2419 | 0.2907 | 0.2478 |
| class | Erysipelotrichia | Control | NA | 0.0104 | NA | NA |
| class | Gammaproteobacteria | Control | 0.1545 | 0.1972 | 0.2209 | 0.3224 |
| class | Gammaproteobacteria | Treated | 0.1826 | 0.1801 | 0.1602 | 0.2116 |
| order | Aeromonadales | Control | 0.0102 | NA | NA | 0.0103 |
| order | Aeromonadales | Treated | 0.0109 | NA | NA | 0.0131 |
| order | Alteromonadales | Control | 0.0151 | 0.0163 | 0.0129 | 0.0250 |
| order | Alteromonadales | Treated | 0.0186 | 0.0151 | 0.0136 | 0.0209 |
| order | Bacillales | Control | 0.0374 | 0.0665 | 0.0497 | 0.0493 |
| order | Bacillales | Treated | 0.0465 | 0.0693 | 0.0452 | 0.0475 |
| order | Bacteroidales | Control | 0.1207 | 0.1028 | 0.0700 | 0.0682 |
| order | Bacteroidales | Treated | 0.1111 | 0.0977 | 0.1176 | 0.0992 |
| order | Betaproteobacteriales | Control | NA | 0.0125 | 0.0279 | 0.0175 |
| order | Betaproteobacteriales | Treated | NA | 0.0124 | 0.0155 | 0.0101 |
| order | Clostridiales | Control | 0.3586 | 0.2556 | 0.1766 | 0.1437 |
| order | Clostridiales | Treated | 0.2875 | 0.2414 | 0.2907 | 0.2475 |
| order | Corynebacteriales | Control | 0.0176 | 0.0251 | 0.0324 | 0.0255 |
| order | Corynebacteriales | Treated | 0.0239 | 0.0285 | 0.0157 | 0.0270 |
| order | Erysipelotrichales | Control | NA | 0.0104 | NA | NA |
| order | Flavobacteriales | Control | 0.0113 | NA | 0.0212 | NA |
| order | Flavobacteriales | Treated | 0.0151 | 0.0110 | 0.0149 | 0.0118 |
| order | Lactobacillales | Control | 0.0491 | 0.0579 | 0.0380 | 0.0363 |
| order | Lactobacillales | Treated | 0.0596 | 0.0534 | 0.0500 | 0.0604 |
| order | Micrococcales | Control | 0.0399 | 0.0429 | 0.0530 | 0.0519 |
| order | Micrococcales | Treated | 0.0524 | 0.0550 | 0.0401 | 0.0506 |
| order | Oceanospirillales | Control | 0.0225 | 0.0331 | 0.0340 | 0.0544 |
| order | Oceanospirillales | Treated | 0.0236 | 0.0278 | 0.0225 | 0.0319 |
| order | Propionibacteriales | Control | 0.0427 | 0.0431 | 0.0550 | 0.0811 |
| order | Propionibacteriales | Treated | 0.0442 | 0.0409 | 0.0292 | 0.0499 |
| order | Pseudomonadales | Control | 0.0823 | 0.1074 | 0.1169 | 0.1931 |
| order | Pseudomonadales | Treated | 0.0948 | 0.0956 | 0.0773 | 0.1128 |
| order | Rhizobiales | Control | 0.0387 | 0.0609 | 0.0853 | 0.1032 |
| order | Rhizobiales | Treated | 0.0384 | 0.0611 | 0.0484 | 0.0619 |
| order | Sphingomonadales | Control | NA | 0.0121 | 0.0253 | 0.0121 |
| order | Sphingomonadales | Treated | 0.0118 | 0.0182 | 0.0154 | NA |
| order | Xanthomonadales | Control | NA | NA | 0.0118 | NA |
| family | Bacillaceae | Control | NA | 0.0104 | 0.0151 | NA |
| family | Bacillaceae | Treated | NA | 0.0159 | 0.0132 | NA |
| family | Bacteroidaceae | Control | 0.0205 | 0.0130 | NA | NA |
| family | Bacteroidaceae | Treated | 0.0164 | 0.0121 | 0.0165 | 0.0106 |
| family | Beijerinckiaceae | Control | 0.0236 | 0.0459 | 0.0453 | 0.0675 |
| family | Beijerinckiaceae | Treated | 0.0246 | 0.0424 | 0.0252 | 0.0345 |
| family | Burkholderiaceae | Control | NA | 0.0118 | 0.0230 | 0.0165 |
| family | Burkholderiaceae | Treated | NA | 0.0117 | 0.0118 | NA |
| family | Carnobacteriaceae | Control | 0.0132 | 0.0131 | NA | NA |
| family | Carnobacteriaceae | Treated | 0.0178 | 0.0135 | 0.0132 | 0.0132 |
| family | Christensenellaceae | Control | 0.0312 | 0.0229 | 0.0117 | NA |
| family | Christensenellaceae | Treated | 0.0261 | 0.0166 | 0.0242 | 0.0202 |
| family | Clostridiaceae 1 | Control | NA | 0.0103 | NA | NA |
| family | Clostridiaceae 1 | Treated | 0.0119 | NA | NA | NA |
| family | Corynebacteriaceae | Control | 0.0153 | 0.0207 | 0.0239 | 0.0201 |
| family | Corynebacteriaceae | Treated | 0.0194 | 0.0214 | 0.0106 | 0.0190 |
| family | Erysipelotrichaceae | Control | NA | 0.0104 | NA | NA |
| family | Family XIII | Control | 0.0130 | NA | NA | NA |
| family | Family XIII | Treated | 0.0108 | NA | NA | NA |
| family | Flavobacteriaceae | Control | NA | NA | 0.0156 | NA |
| family | Flavobacteriaceae | Treated | 0.0109 | NA | 0.0129 | NA |
| family | Halomonadaceae | Control | 0.0217 | 0.0324 | 0.0329 | 0.0514 |
| family | Halomonadaceae | Treated | 0.0226 | 0.0258 | 0.0216 | 0.0303 |
| family | Lachnospiraceae | Control | 0.0734 | 0.0598 | 0.0423 | 0.0317 |
| family | Lachnospiraceae | Treated | 0.0626 | 0.0558 | 0.0590 | 0.0582 |
| family | Lactobacillaceae | Treated | NA | NA | NA | 0.0120 |
| family | Microbacteriaceae | Control | NA | NA | 0.0124 | NA |
| family | Micrococcaceae | Control | 0.0287 | 0.0287 | 0.0239 | 0.0348 |
| family | Micrococcaceae | Treated | 0.0348 | 0.0338 | 0.0235 | 0.0352 |
| family | Moraxellaceae | Control | 0.0369 | 0.0405 | 0.0344 | 0.0522 |
| family | Moraxellaceae | Treated | 0.0441 | 0.0363 | 0.0275 | 0.0456 |
| family | Nocardioidaceae | Control | NA | NA | 0.0154 | NA |
| family | Peptostreptococcaceae | Control | 0.0146 | 0.0159 | 0.0168 | NA |
| family | Peptostreptococcaceae | Treated | 0.0187 | 0.0197 | 0.0136 | 0.0204 |
| family | Prevotellaceae | Control | 0.0354 | 0.0364 | 0.0260 | 0.0272 |
| family | Prevotellaceae | Treated | 0.0371 | 0.0322 | 0.0427 | 0.0333 |
| family | Propionibacteriaceae | Control | 0.0379 | 0.0379 | 0.0396 | 0.0759 |
| family | Propionibacteriaceae | Treated | 0.0389 | 0.0359 | 0.0234 | 0.0445 |
| family | Pseudomonadaceae | Control | 0.0454 | 0.0668 | 0.0825 | 0.1409 |
| family | Pseudomonadaceae | Treated | 0.0507 | 0.0593 | 0.0497 | 0.0672 |
| family | Rhizobiaceae | Control | 0.0105 | NA | 0.0248 | 0.0268 |
| family | Rhizobiaceae | Treated | NA | 0.0110 | 0.0152 | 0.0174 |
| family | Rikenellaceae | Control | 0.0345 | 0.0256 | 0.0173 | 0.0188 |
| family | Rikenellaceae | Treated | 0.0329 | 0.0247 | 0.0322 | 0.0311 |
| family | Ruminococcaceae | Control | 0.2013 | 0.1210 | 0.0813 | 0.0757 |
| family | Ruminococcaceae | Treated | 0.1397 | 0.1189 | 0.1613 | 0.1167 |
| family | Shewanellaceae | Control | NA | NA | NA | 0.0119 |
| family | Sphingomonadaceae | Control | NA | 0.0121 | 0.0253 | 0.0121 |
| family | Sphingomonadaceae | Treated | 0.0118 | 0.0182 | 0.0154 | NA |
| family | Staphylococcaceae | Control | 0.0207 | 0.0438 | 0.0261 | 0.0316 |
| family | Staphylococcaceae | Treated | 0.0224 | 0.0411 | 0.0228 | 0.0273 |
| family | Streptococcaceae | Control | 0.0256 | 0.0299 | 0.0161 | 0.0181 |
| family | Streptococcaceae | Treated | 0.0290 | 0.0244 | 0.0226 | 0.0296 |
| family | Xanthobacteraceae | Control | NA | NA | 0.0118 | NA |
| family | Xanthomonadaceae | Control | NA | NA | 0.0117 | NA |
| genus | [Eubacterium] coprostanoligenes group | Control | 0.0219 | 0.0111 | 0.0103 | NA |
| genus | [Eubacterium] coprostanoligenes group | Treated | 0.0190 | 0.0169 | 0.0192 | 0.0185 |
| genus | Achromobacter | Control | NA | NA | NA | 0.0102 |
| genus | Acinetobacter | Control | NA | 0.0110 | 0.0104 | 0.0221 |
| genus | Acinetobacter | Treated | 0.0116 | 0.0123 | NA | 0.0105 |
| genus | Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium | Control | NA | NA | 0.0125 | 0.0144 |
| genus | Bacillus | Control | NA | NA | 0.0136 | NA |
| genus | Bacillus | Treated | NA | 0.0113 | 0.0116 | NA |
| genus | Bacteroides | Control | 0.0205 | 0.0130 | NA | NA |
| genus | Bacteroides | Treated | 0.0164 | 0.0121 | 0.0165 | 0.0106 |
| genus | Christensenellaceae R-7 group | Control | 0.0308 | 0.0227 | 0.0117 | NA |
| genus | Christensenellaceae R-7 group | Treated | 0.0259 | 0.0166 | 0.0241 | 0.0202 |
| genus | Clostridium sensu stricto 1 | Treated | 0.0104 | NA | NA | NA |
| genus | Corynebacterium 1 | Control | 0.0112 | 0.0154 | 0.0163 | 0.0120 |
| genus | Corynebacterium 1 | Treated | 0.0139 | 0.0161 | NA | 0.0132 |
| genus | Cutibacterium | Control | 0.0365 | 0.0350 | 0.0361 | 0.0734 |
| genus | Cutibacterium | Treated | 0.0360 | 0.0307 | 0.0209 | 0.0416 |
| genus | Flavobacterium | Control | NA | NA | 0.0120 | NA |
| genus | Halomonas | Control | 0.0211 | 0.0313 | 0.0320 | 0.0511 |
| genus | Halomonas | Treated | 0.0219 | 0.0251 | 0.0212 | 0.0298 |
| genus | Lachnospiraceae NK3A20 group | Control | 0.0121 | 0.0113 | NA | NA |
| genus | Lachnospiraceae NK3A20 group | Treated | 0.0137 | 0.0133 | NA | 0.0117 |
| genus | Lactobacillus | Treated | NA | NA | NA | 0.0120 |
| genus | Methylobacterium | Control | 0.0184 | 0.0394 | 0.0401 | 0.0603 |
| genus | Methylobacterium | Treated | 0.0194 | 0.0349 | 0.0219 | 0.0276 |
| genus | Prevotella 1 | Control | 0.0143 | 0.0196 | 0.0161 | 0.0197 |
| genus | Prevotella 1 | Treated | 0.0157 | 0.0164 | 0.0217 | 0.0140 |
| genus | Pseudomonas | Control | 0.0453 | 0.0666 | 0.0825 | 0.1405 |
| genus | Pseudomonas | Treated | 0.0504 | 0.0592 | 0.0495 | 0.0671 |
| genus | Psychrobacter | Control | 0.0249 | 0.0271 | 0.0183 | 0.0233 |
| genus | Psychrobacter | Treated | 0.0292 | 0.0232 | 0.0203 | 0.0283 |
| genus | Rikenellaceae RC9 gut group | Control | 0.0213 | 0.0174 | 0.0113 | 0.0132 |
| genus | Rikenellaceae RC9 gut group | Treated | 0.0207 | 0.0148 | 0.0219 | 0.0223 |
| genus | Ruminococcaceae UCG-005 | Control | 0.0393 | 0.0286 | 0.0187 | 0.0176 |
| genus | Ruminococcaceae UCG-005 | Treated | 0.0303 | 0.0244 | 0.0356 | 0.0241 |
| genus | Ruminococcaceae UCG-010 | Control | 0.0459 | 0.0295 | 0.0169 | 0.0177 |
| genus | Ruminococcaceae UCG-010 | Treated | 0.0354 | 0.0277 | 0.0362 | 0.0291 |
| genus | Ruminococcaceae UCG-013 | Control | 0.0218 | NA | NA | NA |
| genus | Ruminococcaceae UCG-013 | Treated | NA | NA | 0.0161 | NA |
| genus | Ruminococcaceae UCG-014 | Control | 0.0138 | NA | NA | NA |
| genus | Shewanella | Control | NA | NA | NA | 0.0106 |
| genus | Sphingomonas | Control | NA | NA | 0.0113 | NA |
| genus | Staphylococcus | Control | 0.0189 | 0.0384 | 0.0224 | 0.0272 |
| genus | Staphylococcus | Treated | 0.0190 | 0.0367 | 0.0194 | 0.0243 |
| genus | Streptococcus | Control | 0.0254 | 0.0298 | 0.0157 | 0.0176 |
| genus | Streptococcus | Treated | 0.0283 | 0.0233 | 0.0217 | 0.0287 |
Finally,a bubble chart to visualize relative abundances per taxa and treatment:
## `summarise()` has grouped output by 'level', 'new_taxa'. You can override using the `.groups` argument.
The significance of differences between treatments (Control vs Treated with Essential Oil) was evaluated using a linear model (ANOVA) that included the effect of timepoints:
\[ counts_{ikj} = \mu + timepoint_k + treatment_j + e_{ikj} \]
This way, the variability due to region is removed when assessing the effect of treatments.
The significance of differences between treatments (Control vs Treated with Essential Oil) was evaluated using a linear model (ANOVA) that included the effect of timepoints:
\[ counts_{ij} = \mu + treatment_j + e_{ij} \]
this way, the variability due to region is removed when assessing the effect of treatments.
## `summarise()` has grouped output by 'level', 'new_taxa', 'timepoint'. You can override using the `.groups` argument.
## # A tibble: 5 × 2
## level tot
## <chr> <dbl>
## 1 class 4.00
## 2 family 3.89
## 3 genus 3.60
## 4 order 3.99
## 5 phylum 4
# dd_counts$type <- c("ileum","rumen")[match(dd_counts$type,unique(dd_counts$type))]
# dd <- bind_rows(dd_rumen, dd_ileal)
# dd <- dd_counts %>% inner_join(dd, by = c("level" = "level", "new_taxa" = "new_taxa", "type" = "type"))
# dd %>% fwrite("significant_otus_relabund.csv", sep=",")
DX <- D %>%
filter(`p.value` <= 0.05) %>%
select(c(level,new_taxa,timepoint,`p.value`)) %>%
arrange(level,`p.value`)
D0 <- mO %>%
dplyr::group_by(level,new_taxa,timepoint,treatment) %>%
dplyr::summarise(avg_counts = mean(counts))
## `summarise()` has grouped output by 'level', 'new_taxa', 'timepoint'. You can override using the `.groups` argument.
to_save = list(D,DX,D0)
save(to_save, file = "taxonomy_timepoint.RData")
load("taxonomy_timepoint.RData")
D <- to_save[[1]]
DX <- to_save[[2]]
D0 <- to_save[[3]]
dd <- spread(D0, key = treatment, value = avg_counts)
temp <- inner_join(DX,dd, by = c("level" = "level", "new_taxa" = "new_taxa", "timepoint" = "timepoint"))
fwrite(temp, file = "significant_otus.csv", col.names = TRUE, sep = ",")
print (dd)
## # A tibble: 5,472 × 5
## # Groups: level, new_taxa, timepoint [5,472]
## level new_taxa timepoint Control Treated
## <chr> <chr> <fct> <dbl> <dbl>
## 1 class Acidimicrobiia 0 7.72 7.26
## 2 class Acidimicrobiia 8 5.78 7.18
## 3 class Acidimicrobiia 21 17.2 14.6
## 4 class Acidimicrobiia 28 4.31 7.17
## 5 class Acidobacteriia 0 0.145 0.175
## 6 class Acidobacteriia 8 2.41 4.64
## 7 class Acidobacteriia 21 7.88 4.46
## 8 class Acidobacteriia 28 2.41 0.302
## 9 class Actinobacteria 0 293. 379.
## 10 class Actinobacteria 8 276. 335.
## # … with 5,462 more rows
load("taxonomy_timepoint.RData")
D <- to_save[[1]]
DX <- to_save[[2]]
D0 <- to_save[[3]]
D0 <- mutate(D0, avg_counts = avg_counts+1) %>% spread(key = treatment, value = avg_counts)
D1 <- DX %>%
inner_join(D0, by = c("level" = "level", "new_taxa" = "new_taxa", "timepoint" = "timepoint")) %>%
mutate(p.value = -log10(p.value), Control = ifelse(log(Control) < 0,0,log10(Control)), Treated = ifelse(log(Treated) < 0, 0, log10(Treated))) %>%
gather(key = "treatment", value = "counts", -c(level,new_taxa,timepoint,p.value))
D1$level <- factor(D1$level, levels = c("phylum","class","order","family","genus"))
p <- ggplot(D1, aes(x = treatment, y = new_taxa, group=level))
p <- p + geom_tile(aes(fill = counts), colour = "white")
p <- p + facet_grid(level~timepoint, space="free", scales = "free_y")
p <- p + scale_fill_gradient(low = "orange", high = "blue")
p <- p + theme(strip.text.y = element_text(size = 5),
strip.text.x = element_text(size = 6),
# axis.text.y = element_text(size = 4),
axis.text.x = element_text(size = 6),
axis.title = element_text(size = 6))
p <- p + guides(fill=FALSE) + theme(axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.ticks.y = element_blank())
## Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
## "none")` instead.
# p
dd <- filter(D1, treatment == "Control") %>% mutate(variable = "p-value")
q <- ggplot(dd, aes(x = factor(1), y = new_taxa, group=level))
q <- q + geom_tile(aes(fill = p.value), colour = "white")
q <- q + facet_grid(level~variable, space="free", scales = "free_y")
q <- q + scale_fill_gradient(low = "orange", high = "blue")
q <- q + theme(strip.text = element_text(size = 4),
strip.text.x = element_text(size = 6),
axis.text.y = element_text(size = 5),
axis.title = element_text(size = 6))
q <- q + guides(fill=FALSE) + theme(
# axis.title.x = element_blank(),
# axis.text.x=element_blank(),
# axis.ticks.x=element_blank(),
strip.text.y = element_blank(),
# axis.text.x = element_blank()
axis.text.x = element_text(size = 6)
)
## Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
## "none")` instead.
q <- q + xlab("")
figure_final <- ggarrange(q, p, widths=c(0.25, 0.75),
labels=c("A", "B"))
print(figure_final)
#ggsave(filename = "heatmap_MILK.png", plot = figure_final, device = "png", width = 8, height = 10)